package com.itita.ww2.enums;

/**
 * 渠道列表
 * @author NorthLan
 *
 */
public enum ChannelEnum {
	DEFAULT(0), // 自动注册使用渠道
	OFFICIAL, // 官方渠道
	GOOGLE, // 谷歌
	FACEBOOK, // FaceBook
	TWITTER, // Tiwtter
	;
	private int value;

	private ChannelEnum() {
		this(Counter.nextValue);
	}

	private ChannelEnum(int value) {
		this.value = value++;
		Counter.nextValue = value;
	}

	
	public static ChannelEnum valueOf(int value) {
		for (ChannelEnum type : ChannelEnum.values()) {
			if (type.getValue() == value) {
				return type;
			}
		}
		return DEFAULT;
	}

	public int getValue() {
		return value;
	}

	private static class Counter {
		private static int nextValue = 0;
	}
}
